import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'
import './App.less'
import MyAlert from '@/components/MyAlert'
import Tabbar from '@/components/Tabbar'

class App extends Component {
  render() {
    return (
      <div>
        <MyAlert/>
        {this.props.children}
        <Tabbar/>
      </div>
    )
  }
  componentDidMount() {
    // console.log(this.props)
    // 路由重定向
    if (this.props.location.pathname === "/") {
      this.props.history.push('/home')
    }
  }
}


export default withRouter(App)

